package com.lykj.llw.box.adapter.sale

import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.lib_base.component.GlideApp
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.SaleRoleResponse

/**
 * ================================================
 * 角色售卖历史表适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/10/24-15:35
 */
class RoleSaleAdapter:BaseQuickAdapter<SaleRoleResponse.DataDTO,BaseViewHolder>(R.layout.item_reuse_small_account) {
    override fun convert(holder: BaseViewHolder, item: SaleRoleResponse.DataDTO) {
        holder.setText(R.id.tv_game_name, "${item.gamename}")
        holder.setText(R.id.tv_recharge, "游戏充值：${item.paySumPrice}")
        holder.setText(R.id.tv_child, "${item.rolename}")

        GlideApp.with(context)
            .load(item.gameIcon)
            .transition(DrawableTransitionOptions.withCrossFade())
            .into(holder.getView(R.id.iv_icon))
    }
}